package com.letoken.platform.repo.app.dao;

import com.letoken.platform.repo.app.po.AppUserRecharge;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 用户充值记录表 Mapper 接口
 * </p>
 *
 * @author 作者
 * @since 2022-11-18
 */
public interface AppUserRechargeMapper extends BaseMapper<AppUserRecharge> {

    int updateErrorResponse(@Param("hash") String hash, @Param("response") String response);

    Integer countByUserId(@Param("userId") Integer userId);
    Integer countByUserIdList(@Param("userIdList") List<Integer> userIdList);


    @Select("select 1 from app_user_recharge where txid = #{txId} or sn = #{sn} limit 1")
    Integer checkoutTxIdOrSn(@Param("txId") String  txId, @Param("sn") String sn);

}
